package jieke;

public class putong extends people {
    private double shixin;  // 每小时薪资
    private double time;

    public putong(int number, String name, double shixin, double time) {
        /***this.number = number;
        this.name = name;***/
        super(number, name);
        this.shixin = shixin;
        this.time = time;
    }

    public double jisuan() {
        if (time < 0) {
            throw new IllegalArgumentException("工作时长不能为负数！");
        }
        return shixin * time;
    }

    public String gongzitiao() {
        return "工资条\n" +
                "工号：" + number + "\n" +
                "姓名：" + name + "\n" +
                "员工类型：普通员工\n" +
                "工作时长：" + time + "小时\n" +
                "每小时薪资：" + shixin + "\n" +
                "总薪资：" + jisuan();
    }
    public double getShixin() {
        return shixin;
    }

    public double getTime() {
        return time;
    }
}




